package com.zmn.plat.common.dictionary;

/**
 * 基础品牌系数类型枚举
 *
 * @author linfeng
 * @since 2020/06/15 14:56:30
 */
public enum BaseBrandRatioTypeEnum {

    /**
     * values
     */
    BRANDRATIO(102, "品牌默认系数"),
    BRANDCATEGONERATIO(104, "产品一级分类系数"),
    BRANDCATEGTWORATIO(105, "产品二级分类系数"),
    BRANDMETER3RATIO(106, "品牌计价器3.0系数"),
    ;

    private Integer code;
    private String name;

    BaseBrandRatioTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static BaseBrandRatioTypeEnum of(Integer code) {
        if (code == null || code == 0) {
            return BRANDRATIO;
        }
        switch (code) {
            case 102:
                return BRANDRATIO;
            case 104:
                return BRANDCATEGONERATIO;
            case 105:
                return BRANDCATEGTWORATIO;
            default:
                return BRANDRATIO;
        }
    }
}
